package qmm.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import qmm.dao.OrderInfoDao;
import qmm.dao.impl.OrderInfoDaoImpl;
import qmm.entity.vo.OrderVo;

@WebServlet("/OrderInfoServlet")
public class OrderInfoServlet extends BaseServlet{
	OrderInfoDao dao = new OrderInfoDaoImpl();
	
	public void findDetails(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		HttpSession session = request.getSession();
		int orderId = Integer.parseInt(request.getParameter("orderId"));
		
		List<OrderVo> list = dao.findOrder(orderId);
		System.out.println(list);
		session.setAttribute("orderVoList", list);
		response.sendRedirect("order_details.jsp");
	}
}
